package com.wanjia.bpsapi.properties;

import com.wanjia.bpsapi.constant.MapService;
import com.wanjia.bpsapi.constant.MapServiceRoute;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;

import java.util.Map;

@Data
@Configuration
@ConfigurationProperties("map-service")
public class MapServiceProperties {

    /**
     * 服务类型
     *
     * @see MapService
     */
    private MapService service;

    /**
     * 基础url
     */
    private String baseUrl;

    /**
     * 百度地图服务配置
     *
     * @see BaiduMapServiceProperties
     */
    private BaiduMapServiceProperties baidu;

    /**
     * 地图服务路径配置
     */
    private Map<MapServiceRoute, String> routeMap;

    @Data
    public static class BaiduMapServiceProperties {

        /**
         * 访问应用（AK）
         */
        private String ak;

        private ClassPathResource codeMapFile;
    }
}
